package com.lmt.ymcc.schedule;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @Description: TODO
 * @Author: Amazing
 * @Date: 2022/8/24 21:33
 * @Version: 1.0
 */
@Component // 必须交个spring容器管理
@Slf4j
public class ScheduleTest {

    //每天凌晨1点执行一次：0 0 23 * * ?
    //每天晚上，12点，发布秒杀课程到Redis
    @Scheduled(cron = "0/5 * * * * ?")
    public void publishKillCourse2Redis(){
        log.info("定时发布课程");
    }
}
